package SimpleNotepad;

import java.util.Scanner;

public class SecureNotepad extends SimpleNotepad implements ISecureNotepad
{
	private String password;
	
	public SecureNotepad(int numberOfPages) 
	{
		super(numberOfPages);
		this.password = password;
	}

	@Override
	public void addText(int pageNumber, String newText) 
	{
		if(requirePassword())
		{
			super.replaceTextInPage(pageNumber, newText);
		}
	}

	@Override
	public boolean requirePassword() 
	{
		Scanner scan = new Scanner(System.in);
		System.out.println("Enter your password");
		return scan.next().equals(password);

	}

}
